import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import index from '@/views/index'
import Artical from '@/views/page/Artical'
import EditArtical from '@/views/page/EditArtical'

Vue.use(VueRouter)

  const routes = [
    {name:'login',path:'/login',component:Login},
    {
      path:'/',
      component:index,
      meta:{
        auth:true,
        breadcrumb:'首页'
      },
      children:[
        {
          name:'artical',
          path:'artical',
          component:Artical,
          meta:{
            auth:true, 
            breadcrumb:'文章列表'
          }
        },
        {
          name:'editArtical',
          path:'editArtical',
          component:EditArtical,
          meta:{
            auth:true,
            breadcrumb:'编辑文章'
          }
        }
      ]
    }
  ]

const router = new VueRouter({
  routes
})

export default router
